German mathematician who developed the theory of numbers and who applied mathematics to electricity and magnetism and astronomy and geodesy (1777-1855)